package springcloud.service.impl;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import com.nyist.springcloud.ResultVO;
import com.nyist.springcloud.entities.Payment;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import springcloud.service.FeignService;

/**
 * @author yangxiaogen
 * @date 2021/1/31 14:32
 */
@Component
public class FeignServiceFallback implements FeignService {

    @Override
    public ResultVO<Payment> getPaymentOk(Payment payment) {
        ResultVO<Payment> paymentResultVO = new ResultVO<>();

        paymentResultVO.setCode("500");
        paymentResultVO.setMessage("Service,,,ok ----- fallback....");

        return paymentResultVO;
    }

    @Override
    public ResultVO<Payment> getPaymentTimeout(Payment payment) {
        ResultVO<Payment> paymentResultVO = new ResultVO<>();

        paymentResultVO.setCode("500");
        paymentResultVO.setMessage("Service,,,Timeout ----- fallback....");

        return paymentResultVO;
    }

}
